package com.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class HomeController5 {

    //只有请求头部中的content-type=text/plain时才处理你这个请求
    @RequestMapping(value = "/xz", consumes = {"text/plain"})
    public String xianzhi() {
        return "index";
    }

    //发送的请求头部中accept的值是text/plain时才处理这个请求
    // 如果请求中没有设置Accept的值，也可以处理这个请求
    @RequestMapping(value = "/xz2", produces = {"text/plain"})
    public String xianzhi2() {
        return "index";
    }
}
